package com.chinacoal.hr.levelapi.client;

import com.chinacoal.hr.levelapi.client.fallback.EmployeeclientFallback;
import com.chinacoal.hr.levelapi.client.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by jinyabin on 2020/10/29.
 */
@Api(tags = {"查询员工"})
@FeignClient(name = "ccip-hr-attendance",configuration = FeignAutoConfiguration.class,fallback = EmployeeclientFallback.class)
public interface EmployeeClient {


    /**
     * 查询员工信息列表,带分页
     *
     * @param page    :
     * @param limit   :
     * @param empCode :
     * @param empName :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/12/4 2019/12/4
     */
    @ResponseBody
    @GetMapping("/emps")
    @ApiOperation(value = "查询员工信息列表")
    public Result list(@ApiParam("当前页数") long page,
                       @ApiParam("每页条数") long limit,
                       @ApiParam("员工编码") String empCode,
                       @ApiParam("员工姓名") String empName,
                       @ApiParam("机构编码") String orgCode);


    /**
     * 模糊查询员工列表(按姓名）
     *
     * @param empName :
     * @return : java.util.List<com.chinacoal.hr.levelimpl.entity.Employee>
     * @author : YunTao.Li
     * @date : 2019/12/11 2019/12/11
     */
    @GetMapping("/emps/fuzzy")
    @ResponseBody
    @ApiOperation(value = "模糊查询员工列表")
    public Result listFuzzy(@ApiParam("员工姓名") String empName) ;


}
